package com.ruoyi.activity.controller.portal;

import com.ruoyi.activity.req.AccountLoginReq;
import com.ruoyi.activity.service.IAccountService;
import com.ruoyi.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * 用户登录
 *
 * @author wxc
 * @date 2024-05-31
 */
@RestController
@RequestMapping("/portal/account")
public class AccountLoginController {
    @Autowired
    private IAccountService accountService;
    /**
     * 登录
     */
    @PostMapping("/login")
    public R login(@RequestBody@Valid AccountLoginReq req) {
        String token = accountService.login(req);
        return R.ok("token",token);
    }
}
